package com.minimalist.common.entity.lindi.vo.tradeapplicationconfirmletter;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.entity.basic.vo.file.FileVO;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 林地指标交易平台_交易申请确认函 VO实体
 *
 * @author 11987
 */
@Schema(name = "林地指标交易平台_交易申请确认函实体")
public class LindiTradeApplicationConfirmLetterVO implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "确认函ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "confirmLetterId", description = "确认函ID", type = "string")
    private Long confirmLetterId;

    @NotNull(message = "交易指标申请ID不能为空", groups = {Add.class, Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "tradeApplicationId", description = "交易指标申请ID", type = "string")
    private Long tradeApplicationId;

    @NotBlank(message = "确认函名称不能为空", groups = {Add.class, Update.class})
    @Schema(name = "confirmLetterName", description = "确认函名称", type = "string")
    private String confirmLetterName;

    @Schema(name = "confirmLetterCode", description = "确认函编号", type = "string")
    private String confirmLetterCode;

    @NotBlank(message = "确认函类型不能为空", groups = {Add.class, Update.class})
    @Schema(name = "confirmLetterType", description = "确认函类型", type = "string")
    private String confirmLetterType;

    @Schema(name = "signDate", description = "签署日期", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime signDate;

    @Schema(name = "remark", description = "备注", type = "string")
    private String remark;


    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "fileId", description = "文件ID", type = "string")
    private Long fileId;

    @Schema(name = "file", description = "确认函文件", type = "object")
    private FileVO file;


    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    public Long getConfirmLetterId(){
        return confirmLetterId;
    }

    public void setConfirmLetterId(Long confirmLetterId){
        this.confirmLetterId = confirmLetterId;
    }

    public Long getTradeApplicationId(){
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId){
        this.tradeApplicationId = tradeApplicationId;
    }

    public String getConfirmLetterName(){
        return confirmLetterName;
    }

    public void setConfirmLetterName(String confirmLetterName){
        this.confirmLetterName = confirmLetterName;
    }

    public String getConfirmLetterCode(){
        return confirmLetterCode;
    }

    public void setConfirmLetterCode(String confirmLetterCode){
        this.confirmLetterCode = confirmLetterCode;
    }

    public String getConfirmLetterType(){
        return confirmLetterType;
    }

    public void setConfirmLetterType(String confirmLetterType){
        this.confirmLetterType = confirmLetterType;
    }

    public LocalDateTime getSignDate(){
        return signDate;
    }

    public void setSignDate(LocalDateTime signDate){
        this.signDate = signDate;
    }

    public String getRemark(){
        return remark;
    }

    public void setRemark(String remark){
        this.remark = remark;
    }

    public Long getFileId(){
        return fileId;
    }

    public void setFileId(Long fileId){
        this.fileId = fileId;
    }

    public FileVO getFile(){
        return file;
    }

    public void setFile(FileVO file){
        this.file = file;
    }

    public Long getCreateId(){
        return createId;
    }

    public void setCreateId(Long createId){
        this.createId = createId;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime){
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o){
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiTradeApplicationConfirmLetterVO that =
                (LindiTradeApplicationConfirmLetterVO) o;
        return Objects.equals(confirmLetterId, that.confirmLetterId)
                && Objects.equals(tradeApplicationId, that.tradeApplicationId)
                && Objects.equals(confirmLetterName, that.confirmLetterName)
                && Objects.equals(confirmLetterCode, that.confirmLetterCode)
                && Objects.equals(confirmLetterType, that.confirmLetterType)
                && Objects.equals(signDate, that.signDate)
                && Objects.equals(remark, that.remark)
                && Objects.equals(fileId, that.fileId)
                && Objects.equals(file, that.file)
                && Objects.equals(createId, that.createId)
                && Objects.equals(updateId, that.updateId)
                && Objects.equals(createTime, that.createTime)
                && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode(){
        return Objects.hash(confirmLetterId, tradeApplicationId, confirmLetterName, confirmLetterCode, confirmLetterType, signDate, remark, fileId, file, createId, updateId, createTime, updateTime);
    }

    @Override
    public String toString(){
        return "LindiTradeApplicationConfirmLetterVO{" +
                "confirmLetterId=" + confirmLetterId +
                ", tradeApplicationId=" + tradeApplicationId +
                ", confirmLetterName='" + confirmLetterName + '\'' +
                ", confirmLetterCode='" + confirmLetterCode + '\'' +
                ", confirmLetterType='" + confirmLetterType + '\'' +
                ", signDate=" + signDate +
                ", remark='" + remark + '\'' +
                ", fileId=" + fileId +
                ", file=" + file +
                ", createId=" + createId +
                ", updateId=" + updateId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
